#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int removeElement(int* nums, int numsSize, int val)
{
	int src = 0;
	int dest = 0;
	while (src < numsSize)
	{
		if (nums[src]!=val)
		{
			nums[dest++] = nums[src++];
		}
		else
		{
			src++;
		}
	}
	return dest;
}
int main()
{
	int nums[] = { 0,1,2,2,3,0,4,2 };
	int val = 2;
	printf("%d", removeElement(&nums, sizeof(nums) / sizeof(nums[0]),2));
	return 0;
}